package com.wiki.gds.rabbitmq.config;


import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.core.TopicExchange;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RabbitmqConfig {

    @Bean(name = "demoQueue")
    public Queue getQueue(){
        return new Queue("queueName");
    }
    @Bean(name = "demoExchange")
    TopicExchange exchange() {
        return new TopicExchange("exchangeName");
    }
    @Bean
    Binding binding(Queue demoQueue, TopicExchange demoExchange) {
        return BindingBuilder.bind(demoQueue).to(demoExchange).with("routingKey");
    }

}
